import request from '@/plugins/request';

// 获取英雄被动列表（全部版）
export function listChampionPassiveVO() {
    return request.get('/passive/allPassiveVO')
}

// 获取英雄被动列表（分页版）
export function listChampionPassiveVOPage(
    {
        pageNum = 0,
        pageSize = 10,
    } = {}) {
    return request.get('/passive', {
        params: { pageNum, pageSize }
    })
}

// 查询含有被动的英雄总数
export function countChampionHavePassiveF() {
    return request.get('/passive/countChampionHavePassive')
}

// 查询所有的英雄总数
export function countAllChampionF() {
    return request.get('/passive/countAllChampion')
}

// 根据 id 删除英雄被动
export function deleteChampionPassiveById(ChampionId) {
    return request.delete(`/passive/${ChampionId}`)
}

// 根据英雄 title 寻找对应的英雄 id
export function searchChampionId(title) {
    return request.get(`/passive/searchChampionId/${title}`)
}

// 请求没有设置被动的英雄的 title
export function searchNoPassiveChampionF() {
    return request.get('/passive/searchNoPassiveChampion')
}

// 根据英雄 title 查找是否有被动信息
export function titleToPassiveF(title) {
    return request.get(`/passive/titleToPassive/${title}`)
}

// 根据 id 获取 title
export function idToTitleF(id) {
    return request.get(`/passive/idToTitle/${id}`)
}

// 更新英雄被动数据
export function updateChampionPassiveF(passive) {
    return request.put('/passive', passive)
}

// 新增英雄被动
export function newChampionPassiveF(passive) {
    return request.post('/passive', passive)
}

// set0
export function set0F(title) {
    return request.put(`/passive/set0/${title}`)
}

// set1
export function set1F(title) {
    return request.put(`/passive/set1/${title}`)
}

// 根据 id 获取英雄被动详情
export function getChampionPassiveById(id) {
    return request.get(`/passive/${id}`)
}